﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Showroom.DAL;

namespace Showroom.BLL
{
    public class SlideShow : _SlideShow
    {
        public static void DeleteAllSlides()
        {
            try
            {
                SlideShow slides = new SlideShow();
                slides.LoadAll();
                slides.DeleteAll();
                slides.Save();
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }

        public static void DeleteByID(int ID)
        {
            try
            {
                SlideShow slide = new SlideShow();
                slide.LoadByPrimaryKey(ID);
                slide.MarkAsDeleted();
                slide.Save();
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }

        public static SlideShow LoadActiveSlides()
        {
            try
            {
                SlideShow slides = new SlideShow();
                slides.Where.Active.Value = true;
                slides.Query.Load();
                return slides;
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
    }
}
